require(quanteda)
source("functions.R")

toks <- readRDS("data_tokens_ja.RDS") %>% 
    tokens_lookup(dict_ja$keywords)
dfmt <- dfm(toks, remove_padding = TRUE) %>% 
    dfm_group()
dat <- as.data.frame(as.matrix(dfmt) > 0)

saveRDS(dat, "data_dictionary_ja.RDS")

